import {Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn} from 'typeorm';

import {ApiProperty} from "@nestjs/swagger";

@Entity({name:'cart'})
export class CartEntity{

    @PrimaryGeneratedColumn()
    @ApiProperty({description: ''})
    id: number

    @Column()
    @ApiProperty({description: '商品id'})
    productId: number

    @Column()
    @ApiProperty({description: '商品名称'})
    productName: string

    @Column()
    @ApiProperty({description: '商品图片'})
    productImg: string

    @Column()
    @ApiProperty({description: '数量'})
    num: number

    @Column()
    @ApiProperty({description: '价格'})
    price: number

    @Column()
    @ApiProperty({description: '用户id'})
    userId: number

    @CreateDateColumn()
    @ApiProperty({description: '创建时间'})
    createdTime: Date

    @UpdateDateColumn()
    @ApiProperty({description: '更新时间'})
    updatedTime: Date

}